/*
* Copyright (C) 2020 ~ 2024 chaigec All Rights Reserved.
*
* Author:     chaigec <chaigec@163.com>
* Maintainer: chaigec <chaigec@163.com>

 * Use of this source code is governed by MIT license that can be found in the
 * LICENSE file in the root of the source tree. All contributing project authors
 * may be found in the AUTHORS file in the root of the source tree.
*/

#ifndef MK_TCP_SESSION_H
#define MK_TCP_SESSION_H
#include "MkSocket/MkSocket.h"
#include "MkUtil/MkBuffer.h"
#include "MkUtil/MkLock.h"
#include <atomic>

class CMkBuffer;
class CMkEvent;
class CMkTcpServer;
class MkApi CMkTcpSession : public CMkSocket
{
public:
    CMkTcpSession(CMkEvent* pEvent, CMkTimer* pTimer, CMkTcpServer* pServer);
    virtual ~CMkTcpSession();

    CMkTcpServer* GetParentServer() { return m_pTcpServer; }
    virtual Uint32 Check(const CMkTime& NowTime);
    virtual Uint32 OnEventRemoved() override;
private:
    CMkTcpServer                    *m_pTcpServer;
};

#endif
